package com.aistar.hotel.service;


import com.aistar.hotel.entity.HotelPictures;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * Created by wubin on 2019/6/23.
 */
public interface HotelPicturesService {
    @Select("select * from hotelpictures where hotel_name like pictures_src('%',#{pictures_src},'%')")
    List<HotelPictures> findAll(String picturessrc);

    @Select("select * from hotelpictures where hotel_pictures_id=#{id}")
    HotelPictures findById(String id);

    @Insert("insert into hotelpictures values(#{hotelPicturesId},#{hotelId},#{picturesSrc})")
    void save(HotelPictures hotelPictures);

    @Delete("delete from hotelpictures where hotel_pictures_id=#{id}")
    void delete(String id);

    @Update("update hotelpictures set hotel_id=#{hotelId},pictures_src=#{picturesSrc} where hotel_pictures_id=#{hotelPicturesId}")
    void update(HotelPictures hotelPictures);

}
